<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:ui="http://java.sun.com/jsf/facelets" 
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jsp/jstl/core">

    <body>
        <ui:composition>
            <h:form id="userForm">
                <ul id="userMenu">
                    <li>
                        <h:commandLink actionListener="#{logged.clearMenu}" action="/page/person/notification/main.xhtml?faces-redirect=true" class="userMessage">
                            <f:setPropertyActionListener target="#{logged.menuFolder}" value="person"/>
                            <f:setPropertyActionListener target="#{logged.packageName}" value="person"/>
                            <f:setPropertyActionListener target="#{logged.moduleName}" value="notification"/>
                            <f:setPropertyActionListener target="#{logged.masterId}" value="#{logged.loggedId}"/>
                            <f:setPropertyActionListener target="#{logged.moduleAccess}" value="person"/>
                            <c:set var="messageNumber"  value="#{person_notification.messages()}"/>
                            <h:panelGroup styleClass="messageBubble" rendered="#{messageNumber != 0}">
                                <h:outputText value="#{messageNumber}"/>
                            </h:panelGroup>
                        </h:commandLink>
                        <h:panelGroup rendered="#{messageNumber != 0}">
                            <ul class="userMessageList">
                                <li>
                                    <h:dataTable var="notificationsList" value="#{person_notification.list_messages()}"
                                                 styleClass="uml-wrapper">

                                        <h:column>
                                            <h:commandLink action="/page/person/notification/main.xhtml?faces-redirect=true" class="uml-row">
                                                <f:setPropertyActionListener target="#{logged.menuFolder}" value="person"/>
                                                <f:setPropertyActionListener target="#{logged.packageName}" value="person"/>
                                                <f:setPropertyActionListener target="#{logged.moduleName}" value="notification"/>
                                                <f:setPropertyActionListener target="#{logged.masterId}" value="#{logged.loggedId}"/>
                                                <f:setPropertyActionListener target="#{logged.detailId}" value="#{notificationsList.id}"/>
                                                <f:setPropertyActionListener target="#{logged.moduleAccess}" value="person"/>
                                                <h:panelGroup styleClass="uml-rowContent">#{systemLabel.notification1} #{notificationsList.personBeans.nombre} #{notificationsList.personBeans.apellido}</h:panelGroup>
                                                <h:panelGroup styleClass="uml-rowContent uml-rowMessage">#{systemLabel.notification2} #{notificationsList.mensaje}</h:panelGroup>
                                            </h:commandLink>
                                        </h:column>

                                    </h:dataTable>
                                </li>
                            </ul>
                        </h:panelGroup>
                    </li>
                    <li><a href="#" id="user"><h:outputText value="#{logged.loggedName}"/></a>
                        <ul class="firstSubLevel">
                            <li>
                                <h:commandLink actionListener="#{logged.clearMenu}" action="/page/person/user/main.xhtml?faces-redirect=true" value="#{systemLabel.field6}">
                                    <f:setPropertyActionListener target="#{logged.menuFolder}" value="person"/>
                                    <f:setPropertyActionListener target="#{logged.packageName}" value="person"/>
                                    <f:setPropertyActionListener target="#{logged.moduleName}" value="user"/>
                                    <f:setPropertyActionListener target="#{logged.masterId}" value="#{logged.loggedId}"/>
                                    <f:setPropertyActionListener target="#{logged.moduleAccess}" value="user"/>
                                </h:commandLink>
                            </li>

                            <li>
                                <h:commandLink actionListener="#{logged.clearMenu}" action="/page/person/permission/main.xhtml?faces-redirect=true" value="#{systemLabel.field7}">
                                    <f:setPropertyActionListener target="#{logged.menuFolder}" value="person"/>
                                    <f:setPropertyActionListener target="#{logged.packageName}" value="person"/>
                                    <f:setPropertyActionListener target="#{logged.moduleName}" value="user"/>
                                    <f:setPropertyActionListener target="#{logged.masterId}" value="#{logged.loggedId}"/>
                                    <f:setPropertyActionListener target="#{logged.moduleAccess}" value="user"/>
                                </h:commandLink>
                            </li>

                            <li><h:commandLink value="#{systemLabel.field8}" action="#{person_user.unLogin}"/></li>
                        </ul>
                    </li>
                    <li><a id="userSettings" href="#"></a>
                        <ul class="firstSubLevel">
                            <li>
                                <h:commandLink actionListener="#{logged.clearMenu}" action="/page/location/general/main.xhtml?faces-redirect=true" value="#{systemLabel.field9}">
                                    <f:setPropertyActionListener target="#{logged.menuFolder}" value="location"/>
                                    <f:setPropertyActionListener target="#{logged.packageName}" value="location"/>
                                    <f:setPropertyActionListener target="#{logged.moduleName}" value="general"/>
                                    <f:setPropertyActionListener target="#{logged.moduleAccess}" value="location"/>
                                </h:commandLink>
                            </li>  

                            <li>
                                <h:commandLink actionListener="#{logged.clearMenu}" action="/page/university/general/main.xhtml?faces-redirect=true" value="#{systemLabel.field10}">
                                    <f:setPropertyActionListener target="#{logged.menuFolder}" value="university"/>
                                    <f:setPropertyActionListener target="#{logged.packageName}" value="university"/>
                                    <f:setPropertyActionListener target="#{logged.moduleName}" value="general"/>
                                    <f:setPropertyActionListener target="#{logged.moduleAccess}" value="location"/>
                                </h:commandLink>
                            </li> 

                            <li>
                                <h:commandLink actionListener="#{logged.clearMenu}" action="/page/system/configuration/main.xhtml?faces-redirect=true" value="#{systemLabel.field13}">
                                    <f:setPropertyActionListener target="#{logged.menuFolder}" value="system"/>
                                    <f:setPropertyActionListener target="#{logged.packageName}" value="system"/>
                                    <f:setPropertyActionListener target="#{logged.moduleName}" value="system"/>
                                    <f:setPropertyActionListener target="#{logged.masterId}" value="#{logged.loggedId}"/>
                                    <f:setPropertyActionListener target="#{logged.moduleAccess}" value="system"/>
                                </h:commandLink>
                            </li>
                        </ul>
                    </li>
                </ul>
            </h:form>

        </ui:composition>
    </body>
</html>
